﻿
Partial Class App_Master_App
    Inherits MyUI.MasterPageBaseApp


    Protected Sub Page_Init(sender As Object, e As System.EventArgs) Handles Me.Init




        Dim u = MyApp.GetUser(True)

        If u IsNot Nothing AndAlso u.Tab_User_Account.ToList.Count = 0 And Me.Request.Url.AbsolutePath.IndexOf("useraccounts.aspx", StringComparison.OrdinalIgnoreCase) = -1 Then
            'Response.Redirect("~/App/useraccounts.aspx")
        End If

        If u IsNot Nothing AndAlso (u.CurrUserPlan.Plan_Expire_Date < Now Or u.Tab_User_Account.ToList.Count = 0) And
        Me.Request.Url.AbsolutePath.IndexOf("billing.aspx", StringComparison.OrdinalIgnoreCase) = -1 And
        Me.Request.Url.AbsolutePath.IndexOf("useraccounts.aspx", StringComparison.OrdinalIgnoreCase) = -1 Then
            'Response.Redirect("~/App/billing.aspx")
            Response.Redirect("~/App/useraccounts.aspx")
        End If


    End Sub


    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

        SetViewMenu()

        'Me.ScmMain

    End Sub


    Private Sub SetViewMenu()
        Dim ViewMenu As New List(Of Object)
        'Dim MainMenu As New List(Of Object)
        Dim SelClass = "select_menu"
        Dim CurrView = 0 'As MyApp.ViewDatatype = Me.CurrViewData

        Dim SubMenu As List(Of Object)

        '-------------------------------------------------------------
        SubMenu = New List(Of Object)
        SubMenu.Add(New With {.Descr = "Sotto menu 1.1", .class = "", .UrlLink = "ww"})
        SubMenu.Add(New With {.Descr = "Sotto menu 1.2", .class = "", .UrlLink = "ww"})
        SubMenu.Add(New With {.Descr = "Sotto menu 1.3", .class = "", .UrlLink = "ww"})
        SubMenu.Add(New With {.Descr = "Sotto menu 1.4", .class = "", .UrlLink = "ww"})

        ViewMenu.Add(New With {.list = SubMenu, .Descr = "MENU 1"})

        SubMenu = New List(Of Object)
        SubMenu.Add(New With {.Descr = "Sotto menu 2.1", .class = "", .UrlLink = "ww"})
        SubMenu.Add(New With {.Descr = "Sotto menu 2.2", .class = "", .UrlLink = "ww"})
        SubMenu.Add(New With {.Descr = "Sotto menu 2.3", .class = "", .UrlLink = "ww"})
        SubMenu.Add(New With {.Descr = "Sotto menu 2.4", .class = "", .UrlLink = "ww"})


        ViewMenu.Add(New With {.list = SubMenu, .Descr = "MENU 2"})


        For Each l As Object In ViewMenu
            For Each m As Object In l.list
                If False Then
                    m.class = SelClass
                End If
            Next
        Next

        'ViewMenu(0).class = SelClass

        'Me.RptViewMenu.DataSource = ViewMenu ' SplitList(ViewMenu, 2)
        'Me.RptViewMenu.DataBind()
    End Sub

    Protected Sub PostWrite_Send() Handles PostWrite.Send

        'Me.UpPPost.Update()

    End Sub

End Class


